package org.beasy.controls.treeClasses
{
	import mx.collections.ArrayCollection;
	import org.beasy.controls.listClasses.IListItemData;
	
	[Bindable]
	
	/**
	 * 默认的<code>IListItemData</code>实现者
	 * 
	 * @author Marco
	 */	
	public class BasicTreeItemData implements IListItemData
	{
		public function BasicTreeItemData( parent:IListItemData )
		{
			_parent = parent;
		}
		
		//--------------------------------------------------------------------------
		//
		//  Variables
		//
		//--------------------------------------------------------------------------
		
		/**
		 * @private
		 */		
		private var _id:String;
		
		/**
		 * @private
		 */		
		private var _label:String;
		
		/**
		 * @private
		 */		
		private var _selected:Boolean;
		
		/**
		 * @private
		 */		
		private var _selectable:Boolean = true;
		
		/**
		 * @private
		 */		
		private var _children:ArrayCollection = undefined;
		
		/**
		 * @private
		 */		
		private var _parent:IListItemData;
		
		//--------------------------------------------------------------------------
		//
		//  Porperties
		//
		//--------------------------------------------------------------------------
		
		public function get label():String
		{
			return _label;
		}

		public function set label(value:String):void
		{
			_label = value;
		}

		public function get id():String
		{
			return _id;
		}

		public function set id(value:String):void
		{
			_id = value;
		}

		public function set selected(value:Boolean):void
		{
			_selected = value;
		}
		public function get selected():Boolean
		{
			return _selected;
		}
		
		public function set selectable(value:Boolean):void
		{
			_selectable = value;
		}
		
		public function get selectable():Boolean
		{
			return _selectable;
		}
		
		public function set children(value:ArrayCollection):void
		{
			_children = value;
		}
		
		public function get children():ArrayCollection
		{
			return _children;
		}
		
		public function get parent():IListItemData
		{
			return _parent;
		}
	}
}